package com.example.mysql.dto;

import java.util.HashMap;
import java.util.Map;

public class AuthResponse {
    private int code;        // 状态码
    private String message;  // 响应消息
    private Map<String, Object> data = new HashMap<>(); // 响应数据

    // 构造方法
    public AuthResponse(int code, String message) {
        this.code = code;
        this.message = message;
    }

    // 添加数据项的链式方法
    public AuthResponse addData(String key, Object value) {
        this.data.put(key, value);
        return this;
    }

    // Getter/Setter
    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Map<String, Object> getData() {
        return data;
    }

    public void setData(Map<String, Object> data) {
        this.data = data;
    }
}